package com.randao.framework.common.model.response;

/**
 * @Author： ~Mr·Weng~
 * @CreateTime： 2019年-04月-24日  3:39
 * Look at the wine in the glass toast the rich first.
 */

public enum CommonCode implements ResultCode {
    SUCCESS(true, 10000, "操作成功！"),
    FAIL(false, 11111, "操作失败！"),
    NO_QUERY_DATA(false, 10001, "没有查询到数据！"),
    SERVER_ERROR(false, 99999, "抱歉，系统繁忙，请稍后重试！");

    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;

    CommonCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
